package com.adtech.adms.commons.web.tag;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ui.TextFieldTag;

import com.opensymphony.xwork2.util.ValueStack;

/**
 * @author Dormin 
 * @since 2011-5-17 
 * 
 * @Copyright (C) AD Tech Workshop All Right Reserved
 */
public class FilterTextTag extends TextFieldTag {
	/**
	 * @function
	 * @param
	 *
	 * @return
	 * @exception
	 *
	 * @author
	 * @history
	 *
	 */
	private static final long serialVersionUID = -2403498617177317930L;
	protected String exptype;

	public String getExptype() {
		return exptype;
	}

	public void setExptype(String exptype) {
		this.exptype = exptype;
	}

	public String getFormatter() {
		return formatter;
	}

	public void setFormatter(String formatter) {
		this.formatter = formatter;
	}

	protected String formatter;
	protected Boolean hidden;
	protected String perfix;
	protected String filterItemName;
	public String getFilterItemName() {
		return filterItemName;
	}

	public void setFilterItemName(String filterItemName) {
		this.filterItemName = filterItemName;
	}
	public Boolean getHidden() {
		return hidden;
	}

	public void setHidden(Boolean hidden) {
		this.hidden = hidden;
	}

	public String getPerfix() {
		return perfix;
	}

	public void setPerfix(String perfix) {
		this.perfix = perfix;
	}

	@Override
	public Component getBean(ValueStack stack, HttpServletRequest req,
			HttpServletResponse res) {
		return new FilterText(stack, req, res);
	}

	@Override
	protected void populateParams() {
		super.populateParams();
		FilterText filtext = (FilterText) component;
		filtext.setExptype(exptype);
		filtext.setFormatter(formatter);
		filtext.setHidden(hidden);
		filtext.setPerfix(perfix);
		filtext.setFilterItemName(filterItemName);
	}
}
